MAIN_OBJ	= main.o compress_gpu.o compress_cpu.o binary_encoding_gpu.o 
CUDA_HOME       = /home/yuwei/NVIDIA_GPU_Computing_SDK
NVCC_HOME	= /usr/local/cuda
CC              = g++
NVCC            = nvcc 
INCLUDE         = -I./cpp -I$(NVCC_HOME)/include -I$(CUDA_HOME)/C/common/inc 
LIB             = -L/usr/local/lib -L$(NVCC_HOME)/lib64 -L$(CUDA_HOME)/C/lib -lcutil_x86_64 -lcuda -lcudart
CFLAGS          = -O3
NVCCFLAGS       = -O3 -arch=sm_20 --ptxas-options=-v


galigner: $(MAIN_OBJ)
	$(CC) -o compressor $(MAIN_OBJ) $(CFLAGS) $(INCLUDE) $(LIB)
compress_gpu.o: ./cpp/compress_gpu.cu
	$(NVCC) -c ./cpp/compress_gpu.cu $(NVCCFLAGS) $(INCLUDE)
binary_encoding_gpu.o: ./cpp/binary_encoding_gpu.cu
	$(NVCC) -c ./cpp/binary_encoding_gpu.cu $(NVCCFLAGS) $(INCLUDE)
compress_cpu.o: ./cpp/compress_cpu.cpp
	$(CC) -c ./cpp/compress_cpu.cpp $(CFLAGS) $(INCLUDE)
main.o: cpp/main.cpp
	$(CC) -c ./cpp/main.cpp $(CFLAGS) $(INCLUDE)

all: compressor

clean:
	rm -f *.o compressor builder
